﻿/// <reference path="../../yui-3.14-min.js" />
YUI.add('subir-archivo-view', function (Y) {

    Y.SubirRecursoView = Y.Base.create('SubirRecursoView', Y.View, [], {
        loadTemplate: function () {
            debugger
            if (this.template == '') {
                var that = this,
                    request = Y.io('/ExcellentProject/scripts/views/cuestionarios/subidadearchivos/templates/subirrecurso.html', {
                        on: {
                            complete: function (id, response) {
                                that.templateIsCharged = true;
                                that.template = response.responseText;
                                that.render();


                            },
                            failure: function (id, response) {
                                alert(response)
                            }
                        }
                    });
            }
        },
        render: function () {
            this.loadTemplate();
            if (this.templateIsCharged) {
                this.get('container').setHTML(this.template);
            }
        }
    })

}, '0.0.0.1', {
    requires: ['view', 'io', 'handlebars']
})